maintainer="Marian Buschsieweke <marian.buschsieweke@posteo.net>"
pkgname=py3-pytest-dependency
pkgver=0.6.0
pkgrel=0
pkgdesc="Manage dependencies of tests"
url="https://github.com/RKrahl/pytest-dependency"
arch="noarch"
license="MIT"
depends="
	py3-pytest
	"
makedepends="
	py3-gpep517
	py3-setuptools
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/RKrahl/pytest-dependency/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/pytest-dependency-$pkgver"

prepare() {
	default_prepare

	sed -e "s/release = version = \"UNKNOWN\"/release = version = \"$pkgver\"/"\
		-i "$builddir/setup.py"
}

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl

	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
faa2ddee66a09af427571297ea526e588538a5b5bb77d730bac0c2ff0fd44188e23f9f7d799e3a7e96eb7796008ce41b76ff613d2d9587f0e975487296aa6294  py3-pytest-dependency-0.6.0.tar.gz
"
